package com.bytedance.social.controller;

import com.bytedance.social.request.MessageActionRequest;
import com.bytedance.social.request.MessageChatRequest;
import com.bytedance.social.respones.MessageActionResponse;
import com.bytedance.social.respones.MessageChatResponse;
import com.bytedance.social.service.MessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/douyin/message")
public class MessageController {

    @Autowired
    private MessageService messageService;


    @GetMapping("/chat")
    public MessageChatResponse getUserMessageChat(MessageChatRequest messageChatRequest) {
        MessageChatResponse messageChatResponse = messageService.getUserMessageChat(messageChatRequest);
        return messageChatResponse;
    }

    @PostMapping("/action")
    public MessageActionResponse actionMessage(MessageActionRequest messageActionRequest) {
        MessageActionResponse messageActionResponse = messageService.actionMessage(messageActionRequest);
        return messageActionResponse;
    }

}
